<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>OrbbecSDK: ob::Context类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="orbbec_icon.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OrbbecSDK
   &#160;<span id="projectnumber">1.8.3</span>
   </div>
   <div id="projectbrief">OrbbecSDK: 奥比中光 3D 相机开发套件</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="pages.html"><span>相关页面</span></a></li>
      <li><a href="namespaces.html"><span>命名空间</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="hierarchy.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceob.html">ob</a></li><li class="navelem"><a class="el" href="classob_1_1Context.html">Context</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public 类型</a> &#124;
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="classob_1_1Context-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">ob::Context类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>定义 <a class="el" href="classob_1_1Context.html" title="定义 Context 类, 用于获取设备列表，处理设备的回调，日志等级的设置操作 ">Context</a> 类, 用于获取设备列表，处理设备的回调，日志等级的设置操作  
 <a href="classob_1_1Context.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="Context_8hpp_source.html">Context.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public 类型</h2></td></tr>
<tr class="memitem:a86116757cdd1d415d2687a7c9e505372"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#a86116757cdd1d415d2687a7c9e505372">DeviceChangedCallback</a> = std::function&lt; void(std::shared_ptr&lt; <a class="el" href="classob_1_1DeviceList.html">DeviceList</a> &gt; removedList, std::shared_ptr&lt; <a class="el" href="classob_1_1DeviceList.html">DeviceList</a> &gt; addedList)&gt;</td></tr>
<tr class="separator:a86116757cdd1d415d2687a7c9e505372"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad80df0d99a8a939d58a476e00f7432f"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#aad80df0d99a8a939d58a476e00f7432f">LogCallback</a> = std::function&lt; void(<a class="el" href="ObTypes_8h.html#af3552b30cb452c3065783e55bf0a6f42">OBLogSeverity</a> severity, const char *logMsg)&gt;</td></tr>
<tr class="memdesc:aad80df0d99a8a939d58a476e00f7432f"><td class="mdescLeft">&#160;</td><td class="mdescRight">日志回调函数  <a href="#aad80df0d99a8a939d58a476e00f7432f">更多...</a><br /></td></tr>
<tr class="separator:aad80df0d99a8a939d58a476e00f7432f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:add1d4b543d4765207462b1af057244a9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#add1d4b543d4765207462b1af057244a9">Context</a> (const char *configPath=&quot;&quot;)</td></tr>
<tr class="memdesc:add1d4b543d4765207462b1af057244a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">context 是描述 SDK 的 runtime 一个管理类，负责 SDK 的资源申请与释放 context 具备多设备的管理能力，负责枚举设备，监听设备回调，启用多设备同步等功能  <a href="#add1d4b543d4765207462b1af057244a9">更多...</a><br /></td></tr>
<tr class="separator:add1d4b543d4765207462b1af057244a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ca8598da9d7cb72a5e3b2661b9c637b"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#a3ca8598da9d7cb72a5e3b2661b9c637b">~Context</a> () noexcept</td></tr>
<tr class="separator:a3ca8598da9d7cb72a5e3b2661b9c637b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac1dbaaaa2f6a4e53fb039e485d18267b"><td class="memItemLeft" align="right" valign="top">std::shared_ptr&lt; <a class="el" href="classob_1_1DeviceList.html">DeviceList</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#ac1dbaaaa2f6a4e53fb039e485d18267b">queryDeviceList</a> ()</td></tr>
<tr class="memdesc:ac1dbaaaa2f6a4e53fb039e485d18267b"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取枚举到的设备列表  <a href="#ac1dbaaaa2f6a4e53fb039e485d18267b">更多...</a><br /></td></tr>
<tr class="separator:ac1dbaaaa2f6a4e53fb039e485d18267b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4164180385e809c8fd5b2c3defc5711"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#ac4164180385e809c8fd5b2c3defc5711">enableNetDeviceEnumeration</a> (bool enable)</td></tr>
<tr class="memdesc:ac4164180385e809c8fd5b2c3defc5711"><td class="mdescLeft">&#160;</td><td class="mdescRight">使能或禁用网络设备枚举。  <a href="#ac4164180385e809c8fd5b2c3defc5711">更多...</a><br /></td></tr>
<tr class="separator:ac4164180385e809c8fd5b2c3defc5711"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a00a8a9036b00cba9d1f4f6712c3ebb3d"><td class="memItemLeft" align="right" valign="top">std::shared_ptr&lt; <a class="el" href="classob_1_1Device.html">Device</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#a00a8a9036b00cba9d1f4f6712c3ebb3d">createNetDevice</a> (const char *address, uint16_t port)</td></tr>
<tr class="memdesc:a00a8a9036b00cba9d1f4f6712c3ebb3d"><td class="mdescLeft">&#160;</td><td class="mdescRight">通过 IP 地址创建网络设备  <a href="#a00a8a9036b00cba9d1f4f6712c3ebb3d">更多...</a><br /></td></tr>
<tr class="separator:a00a8a9036b00cba9d1f4f6712c3ebb3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4091c5bcd5b1300e6d4f2eb54b6352f4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#a4091c5bcd5b1300e6d4f2eb54b6352f4">changeNetDeviceIpConfig</a> (const char *deviceUid, const <a class="el" href="structOBNetIpConfig.html">OBNetIpConfig</a> &amp;config)</td></tr>
<tr class="memdesc:a4091c5bcd5b1300e6d4f2eb54b6352f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">更改网络设备的 IP 配置。  <a href="#a4091c5bcd5b1300e6d4f2eb54b6352f4">更多...</a><br /></td></tr>
<tr class="separator:a4091c5bcd5b1300e6d4f2eb54b6352f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1dcc95b63547ba0ec763206a81ef8f40"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#a1dcc95b63547ba0ec763206a81ef8f40">setDeviceChangedCallback</a> (<a class="el" href="classob_1_1Context.html#a86116757cdd1d415d2687a7c9e505372">DeviceChangedCallback</a> callback)</td></tr>
<tr class="memdesc:a1dcc95b63547ba0ec763206a81ef8f40"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置设备插拔回调函数  <a href="#a1dcc95b63547ba0ec763206a81ef8f40">更多...</a><br /></td></tr>
<tr class="separator:a1dcc95b63547ba0ec763206a81ef8f40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c428a487db0b5e34ddd5e4b9a35b48b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#a9c428a487db0b5e34ddd5e4b9a35b48b">enableDeviceClockSync</a> (uint64_t repeatInterval)</td></tr>
<tr class="memdesc:a9c428a487db0b5e34ddd5e4b9a35b48b"><td class="mdescLeft">&#160;</td><td class="mdescRight">使能设备时钟同步以同步主机和所有已创建设备的时钟（如果支持）。  <a href="#a9c428a487db0b5e34ddd5e4b9a35b48b">更多...</a><br /></td></tr>
<tr class="separator:a9c428a487db0b5e34ddd5e4b9a35b48b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafe9d3abd6873ae6ab7c82cf3a0c597b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#aafe9d3abd6873ae6ab7c82cf3a0c597b">freeIdleMemory</a> ()</td></tr>
<tr class="memdesc:aafe9d3abd6873ae6ab7c82cf3a0c597b"><td class="mdescLeft">&#160;</td><td class="mdescRight">从内部数据帧内存池中释放空闲内存  <a href="#aafe9d3abd6873ae6ab7c82cf3a0c597b">更多...</a><br /></td></tr>
<tr class="separator:aafe9d3abd6873ae6ab7c82cf3a0c597b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a158039a9dd86f0f7e8a60e14677d6856"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#a158039a9dd86f0f7e8a60e14677d6856">setLoggerSeverity</a> (<a class="el" href="ObTypes_8h.html#af3552b30cb452c3065783e55bf0a6f42">OBLogSeverity</a> severity)</td></tr>
<tr class="memdesc:a158039a9dd86f0f7e8a60e14677d6856"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置全局日志的等级，会同时作用于输出到终端和输出到文件的日志等级  <a href="#a158039a9dd86f0f7e8a60e14677d6856">更多...</a><br /></td></tr>
<tr class="separator:a158039a9dd86f0f7e8a60e14677d6856"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afec33d3a8226ff701dee7c777cea9713"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#afec33d3a8226ff701dee7c777cea9713">setLoggerToFile</a> (<a class="el" href="ObTypes_8h.html#af3552b30cb452c3065783e55bf0a6f42">OBLogSeverity</a> severity, const char *directory)</td></tr>
<tr class="memdesc:afec33d3a8226ff701dee7c777cea9713"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置日志输出到文件  <a href="#afec33d3a8226ff701dee7c777cea9713">更多...</a><br /></td></tr>
<tr class="separator:afec33d3a8226ff701dee7c777cea9713"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1da0bea9057747067ea6776680b45de6"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#a1da0bea9057747067ea6776680b45de6">setLoggerToConsole</a> (<a class="el" href="ObTypes_8h.html#af3552b30cb452c3065783e55bf0a6f42">OBLogSeverity</a> severity)</td></tr>
<tr class="memdesc:a1da0bea9057747067ea6776680b45de6"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置日志输出到终端  <a href="#a1da0bea9057747067ea6776680b45de6">更多...</a><br /></td></tr>
<tr class="separator:a1da0bea9057747067ea6776680b45de6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70e6ed3b860ac6bdd4ef25c048f18f99"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#a70e6ed3b860ac6bdd4ef25c048f18f99">setLoggerToCallback</a> (<a class="el" href="ObTypes_8h.html#af3552b30cb452c3065783e55bf0a6f42">OBLogSeverity</a> severity, <a class="el" href="classob_1_1Context.html#aad80df0d99a8a939d58a476e00f7432f">LogCallback</a> callback)</td></tr>
<tr class="memdesc:a70e6ed3b860ac6bdd4ef25c048f18f99"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置日志回调  <a href="#a70e6ed3b860ac6bdd4ef25c048f18f99">更多...</a><br /></td></tr>
<tr class="separator:a70e6ed3b860ac6bdd4ef25c048f18f99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4881f168178c2d2d28934fc5be901e56"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#a4881f168178c2d2d28934fc5be901e56">loadLicense</a> (const char *filePath, const char *key=<a class="el" href="ObTypes_8h.html#a5eeadb4cea31961aab689e5d7a225e9c">OB_DEFAULT_DECRYPT_KEY</a>)</td></tr>
<tr class="memdesc:a4881f168178c2d2d28934fc5be901e56"><td class="mdescLeft">&#160;</td><td class="mdescRight">加载 license 文件  <a href="#a4881f168178c2d2d28934fc5be901e56">更多...</a><br /></td></tr>
<tr class="separator:a4881f168178c2d2d28934fc5be901e56"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af77259be549896524493d14d32a4e204"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classob_1_1Context.html#af77259be549896524493d14d32a4e204">loadLicenseFromData</a> (const char *data, uint32_t dataLen, const char *key=<a class="el" href="ObTypes_8h.html#a5eeadb4cea31961aab689e5d7a225e9c">OB_DEFAULT_DECRYPT_KEY</a>)</td></tr>
<tr class="memdesc:af77259be549896524493d14d32a4e204"><td class="mdescLeft">&#160;</td><td class="mdescRight">加载 license 数据  <a href="#af77259be549896524493d14d32a4e204">更多...</a><br /></td></tr>
<tr class="separator:af77259be549896524493d14d32a4e204"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>定义 <a class="el" href="classob_1_1Context.html" title="定义 Context 类, 用于获取设备列表，处理设备的回调，日志等级的设置操作 ">Context</a> 类, 用于获取设备列表，处理设备的回调，日志等级的设置操作 </p>

<p>在文件 <a class="el" href="Context_8hpp_source.html">Context.hpp</a> 第 <a class="el" href="Context_8hpp_source.html#l00023">23</a> 行定义.</p>
</div><h2 class="groupheader">成员类型定义说明</h2>
<a class="anchor" id="a86116757cdd1d415d2687a7c9e505372"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classob_1_1Context.html#a86116757cdd1d415d2687a7c9e505372">ob::Context::DeviceChangedCallback</a> =  std::function&lt;void(std::shared_ptr&lt;<a class="el" href="classob_1_1DeviceList.html">DeviceList</a>&gt; removedList, std::shared_ptr&lt;<a class="el" href="classob_1_1DeviceList.html">DeviceList</a>&gt; addedList)&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>在文件 <a class="el" href="Context_8hpp_source.html">Context.hpp</a> 第 <a class="el" href="Context_8hpp_source.html#l00068">68</a> 行定义.</p>

</div>
</div>
<a class="anchor" id="aad80df0d99a8a939d58a476e00f7432f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classob_1_1Context.html#aad80df0d99a8a939d58a476e00f7432f">ob::Context::LogCallback</a> =  std::function&lt;void(<a class="el" href="ObTypes_8h.html#af3552b30cb452c3065783e55bf0a6f42">OBLogSeverity</a> severity, const char *logMsg)&gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>日志回调函数 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">severity</td><td>当前回调的日志等级 </td></tr>
    <tr><td class="paramname">logMsg</td><td>日志消息 </td></tr>
  </table>
  </dd>
</dl>

<p>在文件 <a class="el" href="Context_8hpp_source.html">Context.hpp</a> 第 <a class="el" href="Context_8hpp_source.html#l00117">117</a> 行定义.</p>

</div>
</div>
<h2 class="groupheader">构造及析构函数说明</h2>
<a class="anchor" id="add1d4b543d4765207462b1af057244a9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ob::Context::Context </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>configPath</em> = <code>&quot;&quot;</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>context 是描述 SDK 的 runtime 一个管理类，负责 SDK 的资源申请与释放 context 具备多设备的管理能力，负责枚举设备，监听设备回调，启用多设备同步等功能 </p>

</div>
</div>
<a class="anchor" id="a3ca8598da9d7cb72a5e3b2661b9c637b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual ob::Context::~Context </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a class="anchor" id="ac1dbaaaa2f6a4e53fb039e485d18267b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::shared_ptr&lt;<a class="el" href="classob_1_1DeviceList.html">DeviceList</a>&gt; ob::Context::queryDeviceList </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取枚举到的设备列表 </p>
<dl class="section return"><dt>返回</dt><dd>std::shared_ptr&lt;DeviceList &gt; 返回设备列表类的指针 </dd></dl>

</div>
</div>
<a class="anchor" id="ac4164180385e809c8fd5b2c3defc5711"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ob::Context::enableNetDeviceEnumeration </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>使能或禁用网络设备枚举。 </p>
<p>使能后，网络设备会自动被发现，并且可以通过 <a class="el" href="classob_1_1Context.html#ac1dbaaaa2f6a4e53fb039e485d18267b">queryDeviceList</a> 获取。默认状态可以在配置文件中设置。</p>
<dl class="section attention"><dt>注意</dt><dd>网络设备枚举通过 gvcp 协议，如果设备和主机不在同一个子网，会被发现但是无法连接。</dd></dl>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">enable</td><td>true 使能，false 禁用 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a00a8a9036b00cba9d1f4f6712c3ebb3d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::shared_ptr&lt;<a class="el" href="classob_1_1Device.html">Device</a>&gt; ob::Context::createNetDevice </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>port</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>通过 IP 地址创建网络设备 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>ip 地址 </td></tr>
    <tr><td class="paramname">port</td><td>端口号 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>std::shared_ptr&lt;Device&gt; 返回创建好的设备对象 </dd></dl>

</div>
</div>
<a class="anchor" id="a4091c5bcd5b1300e6d4f2eb54b6352f4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ob::Context::changeNetDeviceIpConfig </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>deviceUid</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structOBNetIpConfig.html">OBNetIpConfig</a> &amp;&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>更改网络设备的 IP 配置。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">deviceUid</td><td>设备唯一 ID，即网络设备 MAC 地址。可以通过 <a class="el" href="classob_1_1DeviceList.html#ac0c1f95a7750bd639d9412c59225c6b9">DeviceList::uid()</a> 函数获取。 </td></tr>
    <tr><td class="paramname">config</td><td>新的 IP 配置。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a1dcc95b63547ba0ec763206a81ef8f40"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ob::Context::setDeviceChangedCallback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classob_1_1Context.html#a86116757cdd1d415d2687a7c9e505372">DeviceChangedCallback</a>&#160;</td>
          <td class="paramname"><em>callback</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置设备插拔回调函数 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">callback</td><td>设备插拔时触发的回调函数 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a9c428a487db0b5e34ddd5e4b9a35b48b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ob::Context::enableDeviceClockSync </td>
          <td>(</td>
          <td class="paramtype">uint64_t&#160;</td>
          <td class="paramname"><em>repeatInterval</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>使能设备时钟同步以同步主机和所有已创建设备的时钟（如果支持）。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">repeatInterval</td><td>自动重复同步的时间间隔，以毫秒为单位。如果值为 0，则仅执行一次同步。 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aafe9d3abd6873ae6ab7c82cf3a0c597b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ob::Context::freeIdleMemory </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>从内部数据帧内存池中释放空闲内存 </p>

</div>
</div>
<a class="anchor" id="a158039a9dd86f0f7e8a60e14677d6856"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void ob::Context::setLoggerSeverity </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ObTypes_8h.html#af3552b30cb452c3065783e55bf0a6f42">OBLogSeverity</a>&#160;</td>
          <td class="paramname"><em>severity</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置全局日志的等级，会同时作用于输出到终端和输出到文件的日志等级 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">severity</td><td>日志输出等级 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="afec33d3a8226ff701dee7c777cea9713"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void ob::Context::setLoggerToFile </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ObTypes_8h.html#af3552b30cb452c3065783e55bf0a6f42">OBLogSeverity</a>&#160;</td>
          <td class="paramname"><em>severity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>directory</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置日志输出到文件 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">severity</td><td>输出到文件的日志等级 </td></tr>
    <tr><td class="paramname">directory</td><td>日志文件输出路径，如果路径为空，则继续使用已有设置 (已有配置也为空则不输出日志到文件) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a1da0bea9057747067ea6776680b45de6"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void ob::Context::setLoggerToConsole </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ObTypes_8h.html#af3552b30cb452c3065783e55bf0a6f42">OBLogSeverity</a>&#160;</td>
          <td class="paramname"><em>severity</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置日志输出到终端 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">severity</td><td>输出到终端的日志等级 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a70e6ed3b860ac6bdd4ef25c048f18f99"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void ob::Context::setLoggerToCallback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="ObTypes_8h.html#af3552b30cb452c3065783e55bf0a6f42">OBLogSeverity</a>&#160;</td>
          <td class="paramname"><em>severity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classob_1_1Context.html#aad80df0d99a8a939d58a476e00f7432f">LogCallback</a>&#160;</td>
          <td class="paramname"><em>callback</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>设置日志回调 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">severity</td><td>日志回调等级 </td></tr>
    <tr><td class="paramname">callback</td><td>回调函数 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a4881f168178c2d2d28934fc5be901e56"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void ob::Context::loadLicense </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>filePath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em> = <code><a class="el" href="ObTypes_8h.html#a5eeadb4cea31961aab689e5d7a225e9c">OB_DEFAULT_DECRYPT_KEY</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>加载 license 文件 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">filePath</td><td>license 文件路径 </td></tr>
    <tr><td class="paramname">key</td><td>解密的 key </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af77259be549896524493d14d32a4e204"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void ob::Context::loadLicenseFromData </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>dataLen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>key</em> = <code><a class="el" href="ObTypes_8h.html#a5eeadb4cea31961aab689e5d7a225e9c">OB_DEFAULT_DECRYPT_KEY</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>加载 license 数据 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>license 数据 </td></tr>
    <tr><td class="paramname">dataLen</td><td>license 数据长度 </td></tr>
    <tr><td class="paramname">key</td><td>解密的 key </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>header_cn/libobsensor/hpp/<a class="el" href="Context_8hpp_source.html">Context.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2023年 十一月 24日 星期五 10:56:17 , 为 OrbbecSDK使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
